<?php
declare (strict_types = 1);

namespace app\week2\validate;

use think\Validate;

class Article extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'title' => 'require|unique:article',
        'logo' => 'require|fileSize:10240000|fileExt:png,jpeg,gif'
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'title.require' => '标题必须填写',
        'logo.require' => 'logo大小不对'
    ];
}
